#ifndef BBox_h
#define BBox_h


#include "Vector3f.h"
#include <stdint.h>
#include <fstream>
#include <iostream>
using std::ofstream;
using std::ostream;

struct BBox {
  Vector3f min, max, extent;
  BBox() { }
  BBox(const Vector3f& min, const Vector3f& max);
  BBox(const Vector3f& p);

  void expandToInclude(const Vector3f& p);
  void expandToInclude(const BBox& b);
  uint32_t maxDimension() const;
  float surfaceArea() const;

  friend ofstream& operator << (ofstream& out, const BBox& box) { out << box.min << ' ' << box.max; return out; }
  friend ostream& operator << (ostream& out, const BBox& box) { out << box.min << ' ' << box.max; return out; }
};

#endif
